<?php
$allItems = $this->allItems;
$currentPage = $this->currentPage;

if ($currentPage) {
    // check exists parent
    if ($currentPage['all_parent']) {
        $allParent = explode(',', $currentPage['all_parent']);
        if (isset($allParent[0])) {
            $allCategory = $this->allCategory;
            foreach($allParent as $parentID):
                $parent = $allCategory[$parentID];
                // check to ignore root
                if ($parent['left'] != 1) {
                ?>
                    <a href="<?php echo BASE_PATH . '/' . CURR_APP ?>?pid=<?php echo $parent['category_id']?>"><?php echo $parent['admin_title'];?></a> >> 
                <?php
                }
            endforeach;
        }
        echo $currentPage['admin_title'];
    }
}
if (isset($allItems[0])) {
    foreach($allItems as $item):
    ?>
    <div style="padding: 10px;text-align:center;float:left;width:205px;height:230px;overflow:hidden;">
		<?php
		$path = pathinfo($item['item_image'], PATHINFO_DIRNAME);
		$fileName = pathinfo($item['item_image'], PATHINFO_BASENAME);
		?>
		<img src="<?=ImageUtil::getImage($path,$fileName,200,200, 100,true)?>" class="border">
        <div><a href="<?php echo BASE_PATH . '/' . CURR_APP ?>/index/index/detail?pid=<?php echo $item->category_id; ?>&id=<?php echo $item->item_id; ?>"><?php echo $item->item_title; ?></a></div>
        <div style="clear:both;"></div>
    </div>


    <?php
    endforeach;
    
    echo $this->paging;
} // if items
?>